%list-common {
  padding-left: 2em;
  margin-bottom: 24px;
  /* Drop margins inside of multi-level lists. */
  ol, ul { margin-bottom: 0 }
}

#guide {
  ul {
    list-style: disc;
    @extend %list-common;
    li {
      /* Elastic's main.css leaks into the docs and sets this to none so we
       * have to set it back here. */
      list-style: inherit;
    }
  }
  ol {
    list-style: decimal;
    @extend %list-common;

    /* Respect explicitly typed lists. */
    &[type=a] {
      list-style: lower-alpha;
    }
    &[type="1"] {
      list-style: decimal;
    }
  }
  li {
    padding: 0.15em 1em 0.15em 0;
    /* Style implicitly typed lists. */
    ol { list-style: lower-alpha; }
    li {
      ol { list-style: lower-roman; }
      li {
        ol { list-style: upper-alpha; }
      }
    }
  }
  /* Moves lists that directly follow paragraphs inside of dd and li close under
   * the paragraph so they look more "togeter". */
  dd, li {
    & > p + div {
      &.orderedlist,
      &.itemizedlist {
        margin-top: -0.9em;
      }
    }
  }
}